package com.wbs.rest.util;

import java.io.*;
import java.nio.charset.Charset;

public class IOUtil {

    public static String readFromInputStream(InputStream inputStream, Charset charset) throws IOException {
        byte[] bytes = new byte[1024];
        StringBuffer buffer = new StringBuffer();
        while (inputStream.read(bytes) > 0){
            buffer.append(new String(bytes, charset));
        }
        return buffer.toString();
    }

}
